//
//  XUBaseController.m
//  新浪微博
//
//  Created by xuwenxin on 15-4-12.
//  Copyright (c) 2015年 xuwenxin. All rights reserved.
//

#import "XUBaseController.h"
#import "XUOuthModel.h"

@interface XUBaseController () <XUMainViewDelegate>

@end

@implementation XUBaseController

- (void)loadView
{

    XUOuthModel *model = [XUOuthModel accountFromSandbox];
    NSLog(@"model = %@",model.expires_time);
    if (model) {
        [super loadView];
        NSLog(@"%@调用了super loadView",self);
    } else {
    
    XUMainView *v = [XUMainView mainView];
    v.delegate = self;
//        __weak typeof(self) weakSelf = self;
//        v.myBlock = ^{
//            UIStoryboard *sb = [UIStoryboard storyboardWithName:@"XUWebView" bundle:nil];
//            UINavigationController *nav = sb.instantiateInitialViewController;
//            [weakSelf presentViewController:nav animated:YES completion:nil];
//        };
    self.view = v;
    self.manView = v;
    NSLog(@"loadView======");
    }
}

- (void)XUMainViewDelegate
{
    UIStoryboard *sb = [UIStoryboard storyboardWithName:@"XUWebView" bundle:nil];
    UINavigationController *nav = sb.instantiateInitialViewController;
    [self presentViewController:nav animated:YES completion:nil];
}


- (void)viewDidLoad {
    [super viewDidLoad];
    
}

@end
